﻿using MediatR;
using Warehouse.Domain;
using Warehouse.Infrstructre.Interface;
using Warehouse.Read.API.Applcation.Command.StorehouseCommand;

namespace Warehouse.Read.API.Applcation.CommandHandlers.StorehouseCommandhandlers
{
    public class SelectWareListCommandHandlers:IRequestHandler<SelectWareListCommand, List<Warehouseinfo>>
    {

        private readonly  IWarehouseRepository _warehouseRepository;
public SelectWareListCommandHandlers(IWarehouseRepository warehouseRepository)
        {
            _warehouseRepository = warehouseRepository;
        }

        public async Task<List<Warehouseinfo>> Handle(SelectWareListCommand request, CancellationToken cancellationToken)
        {
            return await _warehouseRepository.GetAllAsyns();
        }
    }
}
